<template>
	<view class="my-content _page">
		<!-- 通知 -->
		<Notification />
		<!-- 通知 -->
		<!-- <tabbar /> -->
		<div class="status-bar"></div>
		<view class="order_top" style="z-index: 999;">

			<!--这里是订单导航tabbar-->
			<view class="lxy-content">
				<scroll-view scroll-x="true" class="content-scroll" scroll-with-animation :scroll-left="scrollLeft">
					<block v-if="lang==='zh'">
						<view class="tabs scroll-item" :class="[current == index ? 'border' : '']"
							v-for="(item, index) in list" :key="index" @click="change(index)">
							{{item.name}}
						</view>
					</block>
					<block v-if="lang!='zh'">
						<view class="tabs_ru scroll-item" :class="[current == index ? 'border' : '']"
							v-for="(item, index) in list" :key="index" @click="change(index)">
							{{item.name}}
						</view>
					</block>
				</scroll-view>
			</view>

			<!--这里是订单导航筛选器-->
			<u-dropdown active-color="#FF8006" style="background: #F6F6F6;">
				<u-dropdown-item v-model="value0" :options="options0" active-color="#FF8006" :title="$t('状态')"
					@change="select"></u-dropdown-item>
				<u-dropdown-item v-model="value1" :options="options1" active-color="#FF8006" :title="$t('行业')"
					@change="select"></u-dropdown-item>
				<u-dropdown-item v-model="value2" :options="options2" :title="$t('发布时间')"
					@change="select"></u-dropdown-item>
			</u-dropdown>
		</view>

		<!-- <scroll-view :enable-back-to-top="true" :refresher-enabled="true" :refresher-triggered="triggered"
				:scroll-y="true" class="my-content" lower-threshold="50" @refresherrefresh="scrolltolower1()"
				@scrolltolower="scrolltolowers()">	 -->
		<scroll-view @scrolltolower="scrolltolowers()" :scroll-y="true" class="my-content" lower-threshold="50"
			style="background: #F6F6F6;">

			<u-empty v-if="!orderList||orderList.length==0"></u-empty>
			<!--订单列表-->
			<view class="order_body">
				<view v-for="(item, index) in orderList" :key="index" class="order_card">
					<!-- 货物 -->
					<template v-if="item.type === 'goods'">
						<ItemGoods :isOrder="true" :isRow="1" :orderDetail="{}" :item="item.release_info" :type="2"
							:orderjoin="item" :identity_type="identity_type" :status="item.status"
							:push_count="item.push_count" :jb_count="item.jb_count">

							<template v-slot:orderStatus>
								<view style="padding-top: 10px;" :class="{pur_color: identity_type === 3}">
									<text class="right_title">{{orderStatus2(item.status)}}</text>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:list>
								<view class="my-order-item">
									<view class="my_wrap" :class="{pur_style: identity_type === 3}">
										<text class="my-label" style="display: none;">{{ $t('类型') }}：</text>
										<text class="my-text">{{ $t("货物竞标") }}</text>
									</view>
								</view>
								<!-- <view class="my-order-item" style="margin-bottom: 20rpx;">						
										<view class="my-label">{{ $t('订单号') }}：</view>
										<view class="my-text">{{ item.order_no || item.join_order_no }}</view>
									</view> -->
							</template>

							<template v-slot:flag>
								<view style="width: 100%;margin-top: 30rpx;" v-if="chaxun(item.status)">
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px; font-size: 12px;">
												{{ $t('交易合同') }}
											</view>
											<view class="circle_">
												<image v-if="item.confirm_contract_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.confirm_contract_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view v-if="item.is_margin==2"
										style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('赔付协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_compensation_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_compensation_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('免责协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_agreement_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_agreement_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:btns>
								<view class="order_body_details"
									:class="{three:item.status == 1,purchase_wrap: identity_type === 3 || identity_type === 0}">
									<view v-if="item.status == 1" @click="giveup(item)" class="button">{{ $t('放弃') }}
									</view>
									<view v-if="item.status == 1"
										@click="details(item.id,'',item.status,item.join_order_id,item.type)"
										class="button">{{ $t('修改参与信息') }}</view>
									<view v-if="item.status == 8|| item.status ==10" class="button"
										style="border-bottom-right-radius: 0;" @click="goRatie(item.id)">
										{{ ($t('查看评价')) }}
									</view>
									<view class="button"
										:style="{'border-bottom-right-radius':(item.status==1||item.status==8||item.status==10)?'0rpx':''}"
										@click="details(item.id,true,item.status,item.join_order_id,item.type)">
										{{ ($t('查看详情')) }}
									</view>
								</view>
							</template>

							<template v-slot:bottom>
								<view v-if="chaxun(item.status)" style="height: 50rpx;">
									<scroll-view class="scroll-view" scroll-y="true" style="height: 50rpx;">
										<view class="scroll-text">
											<view v-if="item.bottom_tan&&item.bottom_tan.length!=0"
												v-for="(it,ind) in item.bottom_tan" :key="ind"
												style="margin-top: 10rpx;width: 100%;display: flex;">
												<view class="after_sale_text">
													<text
														style="color: red;font-size: 40px;position: absolute;left: 0px;top: -10px;">
														·
													</text>
													<text
														style="color: #000000;font-size: 10px;padding-left: 12px;">{{$t(it.name)}}</text>
												</view>
												<view class="after_sale_time">{{it.create_at}}</view>
											</view>
										</view>
									</scroll-view>
								</view>
							</template>


						</ItemGoods>
					</template>
					<!-- 运输 -->
					<template v-if="item.type === 'transport'">
						<ItemTransportList :isOrder="true" :orderDetail="{}" :isRow="1" :item="item.release_info"
							:status="item.status" :type="2" :identity_type="identity_type">
							<template v-slot:orderStatus>
								<view style="padding-top: 10px;">
									<text
										style="color: #3d3d3d; font-size: 12px; float: right; ">{{orderStatus2(item.status)}}</text>
									<view style="clear: both;"></view>
								</view>

							</template>
							<template v-slot:list>

								<view class="my-order-item">
									<view class="type-status">
										<text class="my-label" style="display: none;">{{ $t('类型') }}：</text>
										<text class="my-text">
											{{ $t("运输") }}
											<template v-if="item.release_info.release_type == '1'">
												-{{ $t("有车求货") }}
											</template>
											<template v-if="item.release_info.release_type == '2'">
												-{{ $t("有货求车") }}
											</template>
											<template v-if="item.release_info.release_type == '3'">
												<template v-if="item.release_info.human_type == '1'">
													-{{ $t("人力捎货") }}
												</template>
												<template v-if="item.release_info.human_type == '2'">
													-{{ $t("货源信息") }}
												</template>
											</template>
										</text>
									</view>
								</view>
								<!-- <view class="my-order-item" style="margin-bottom: 20rpx;">
										<view class="my-label">{{ $t('订单号') }}：</view>
										<view class="my-text">{{ item.order_no || item.join_order_no }}</view>
									</view> -->
							</template>

							<template v-slot:flag>

								<view style="width: 100%;margin-top: 30rpx;" v-if="chaxun(item.status)">
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('交易合同') }}
											</view>
											<view class="circle_">
												<image v-if="item.confirm_contract_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.confirm_contract_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view v-if="item.is_margin==2"
										style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('赔付协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_compensation_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_compensation_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('免责协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_agreement_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_agreement_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:btns>
								<view class="order_body_details"
									:class="{purchase_wrap: identity_type === 3 || identity_type === 0}">
									<view v-if="item.status == 1" @click="giveup(item)">
										<view class="my-edit">{{ $t('放弃') }}</view>
									</view>
									<view v-if="item.status == 1"
										@click="details(item.id,'',item.status,item.join_order_id,item.type)">
										<view class="my-edit">{{ $t('修改参与信息') }}</view>
									</view>
									<view v-if="item.status == 8|| item.status ==10">
										<view class="button" @click="goRatie(item.id)">
											{{ ($t('查看评价')) }}
										</view>
									</view>
									<view>
										<view class="button"
											@click="details(item.id,true,item.status,item.join_order_id,item.type)">
											{{ ($t('查看详情')) }}
										</view>
									</view>
								</view>
							</template>

							<template v-slot:bottom>
								<view v-if="chaxun(item.status)" style="height: 50rpx;">
									<scroll-view class="scroll-view" scroll-y="true" style="height: 50rpx;">
										<view class="scroll-text">
											<view v-if="item.bottom_tan&&item.bottom_tan.length!=0"
												v-for="(it,ind) in item.bottom_tan" :key="ind"
												style="margin-top: 10rpx;width: 100%;display: flex;">
												<view class="after_sale_text">
													<text
														style="color: red;font-size: 40px;position: absolute;left: 0px;top: -10px;">
														·
													</text>
													<text
														style="color: #000000;font-size: 10px;padding-left: 12px;">{{$t(it.name)}}</text>
												</view>
												<view class="after_sale_time">{{it.create_at}}</view>
											</view>
										</view>
									</scroll-view>
								</view>
							</template>

						</ItemTransportList>
					</template>
					<!-- 货代 -->
					<template v-if="item.type === 'crossborder'">

						<ItemFreightForwarder :isOrder="true" :orderDetail="{}" :isRow="1" :item="item.release_info"
							:type="2" :identity_type="identity_type" :status="item.status">
							<template v-slot:orderStatus>
								<view style="padding-top: 10px;">
									<text
										style="color: #3d3d3d; font-size: 12px; float: right;">{{orderStatus2(item.status)}}</text>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:list>
								<view class="my-order-item">
									<view class="type-status">
										<text class="my-label" style="display: none;">{{ $t('类型') }}：</text>
										<text class="my-text">{{ $t("跨境货代") }}</text>
									</view>
								</view>
								<!-- <view class="my-order-item" style="margin-bottom: 20rpx;">						
										<view class="my-label">{{ $t('订单号') }}：</view>
										<view class="my-text">{{ item.order_no || item.join_order_no }}</view>
									</view> -->
							</template>

							<template v-slot:flag>
								<view style="width: 100%;margin-top: 30rpx;" v-if="chaxun(item.status)">
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('交易合同') }}
											</view>
											<view class="circle_">
												<image v-if="item.confirm_contract_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.confirm_contract_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view v-if="item.is_margin==2"
										style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('赔付协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_compensation_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_compensation_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="float: left;width: auto;margin-left: 1%;margin-top: 5rpx;">
										<view style="background-color: #eeeeee;display: flex;border-radius: 10rpx;">
											<view style="padding: 5px 10px;font-size: 12px;">
												{{ $t('免责协议') }}
											</view>
											<view class="circle_">
												<image v-if="item.is_agreement_biao==1"
													:src='serverImageUrl("/static/lv.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
												<image v-if="item.is_agreement_biao!=1"
													:src='serverImageUrl("/static/lv1.png")'
													style="width: 100%;height: 100%;" mode="aspectFill"></image>
											</view>
										</view>
									</view>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:btns>
								<view class="order_body_details"
									:class="{purchase_wrap: identity_type === 3 || identity_type === 0}">
									<view v-if="item.status == 1" @click="giveup(item)">
										<view class="my-edit">{{ $t('放弃') }}</view>
									</view>
									<view v-if="item.status == 1"
										@click="details(item.id,'',item.status,item.join_order_id,item.type)">
										<view class="my-edit">{{ $t('修改参与信息') }}</view>
									</view>
									<view v-if="item.status == 8|| item.status ==10">
										<view class="button" @click="goRatie(item.id)">
											{{ ($t('查看评价')) }}
										</view>
									</view>
									<view>
										<view class="button"
											@click="details(item.id,true,item.status,item.join_order_id,item.type)">
											{{ ($t('查看详情')) }}
										</view>
									</view>
								</view>
							</template>

							<template v-slot:bottom>
								<view v-if="chaxun(item.status)" style="height: 50rpx;">
									<scroll-view class="scroll-view" scroll-y="true" style="height: 50rpx;">
										<view class="scroll-text">
											<view v-if="item.bottom_tan&&item.bottom_tan.length!=0"
												v-for="(it,ind) in item.bottom_tan" :key="ind"
												style="margin-top: 10rpx;width: 100%;display: flex;">
												<view class="after_sale_text">
													<text
														style="color: red;font-size: 40px;position: absolute;left: 0px;top: -10px;">
														·
													</text>
													<text
														style="color: #000000;font-size: 10px;padding-left: 12px;">{{$t(it.name)}}</text>
												</view>
												<view class="after_sale_time">{{it.create_at}}</view>
											</view>
										</view>
									</scroll-view>
								</view>
							</template>

						</ItemFreightForwarder>
					</template>
					<!-- 专业代办 -->
					<template v-if="item.type === 'professional'">

						<ItemAgencyList :hidechat="true" :isOrder="true" :isRow="1" :item="item.release_info" :type="2">

							<template v-slot:orderStatus>
								<view style="padding-top: 10px;">
									<text
										style="color: #3d3d3d; font-size: 22rpx; float: right; ">{{orderStatus2(item.status)}}</text>
									<view style="clear: both;"></view>
								</view>
							</template>

							<template v-slot:list>
								<view class="my-order-item">
									<view class="type-status">
										<text class="my-label" style="display: none;">{{ $t('类型') }}：</text>
										<text class="my-text">{{ $t("佣金发布") }}</text>
									</view>
								</view>
								<!-- <view class="my-order-item" style="margin-bottom: 20rpx;">
										<view class="my-label">{{ $t('订单号') }}：</view>
										<view class="my-text">{{ item.order_no || item.join_order_no }}</view>
									</view> -->
							</template>
							<template v-slot:btns>
								<!-- linear-gradient(99deg, #FF8C7B 15%, #FFD1A2 99%); -->
								<view class="order_body_details">
									<view v-if="item.status == 1" @click="giveup(item)">
										<view class="my-edit">{{ $t('放弃') }}</view>
									</view>
									<view v-if="item.status == 1"
										@click="details(item.id,'',item.status,item.join_order_id,item.type)">
										<view class="my-edit">{{ $t('修改参与信息') }}</view>
									</view>
									<view v-if="item.status == 8|| item.status ==10">
										<view class="button" @click="goRatie(item.id)">
											{{ ($t('查看评价')) }}
										</view>
									</view>
									<view>
										<view class="button"
											@click="details(item.id,true,item.status,item.join_order_id,item.type)">
											{{ ($t('查看详情')) }}
										</view>
									</view>
								</view>
							</template>
						</ItemAgencyList>
					</template>
				</view>

				<!-- 未评价弹窗 -->
				<Rate v-if="show">
					<view style="width: 480rpx;color: white;">
						<view>{{ $t('你有订单已超过七天未评价，请先评价') }}</view>
						<view class="estimate">
							<view @click="show = !show">{{ $t('取消') }}</view>
							<view @click="estimate">{{ $t('去评价') }}</view>
						</view>
					</view>
				</Rate>


				<view style="height: 150px;"></view>
			</view>

		</scroll-view>



	</view>
</template>

<script>
	import Rate from "@/components/frame.vue"
	import tabbar from "@/components/tabbar/index.vue";
	import {
		HTTP_IMG_UTL
	} from '@/config/app';
	import ItemGoods from "@/components/detail/GoodsItem2.vue";
	import ItemAgencyList from '@/components/detail/AgencyListItem.vue'
	import ItemTransportList from "@/components/detail/TransportListItem.vue";
	import ItemFreightForwarder from '@/components/detail/FreightForwarderItem.vue'

	export default {
		components: {
			tabbar,
			Rate,
			ItemGoods,
			ItemAgencyList,
			ItemTransportList,
			ItemFreightForwarder
		},
		computed: {
			//当前状态名称
			orderStatus() {
				return this.list[this.current].name
			},
			returnMarginBtn() {
				// #ifdef  MP-WEIXIN
				return `padding-top:${(Number(uni.getMenuButtonBoundingClientRect().bottom) + 15) * 2}rpx`
				// #endif
				//#ifndef  MP-WEIXIN
				return "padding-top:97.67rpx"
				//#endif
			},
			workRefresh() {
				return this.$store.state.workRefresh;
			}
		},
		watch: {
			workRefresh() {
				this.log(123);
			}
		},
		data() {
			return {
				show: false,
				lang: this.$i18n.locale,

				isShow: 0,
				contentScrollW: 0, // 导航区宽度
				current: 1, // 当前选中
				scrollLeft: 0, // 横向滚动条位置

				/* 状态配置 
				"已发布":"Опубликовано",
				"已参与": "Участвовал",
				"进行中": "В настоящее время",
				"已完成": "Готово'или'Выполнено",	
				*/
				nav_class: "tabs",
				list: [{
						name: this.$t('全部'),
						zn: HTTP_IMG_UTL + 'Zyifabu.jpg',
						ru: HTTP_IMG_UTL + 'yifabu.jpg'
					},
					{
						name: this.$t('已发布'),
						zn: HTTP_IMG_UTL + 'Zyifabu.jpg',
						ru: HTTP_IMG_UTL + 'yifabu.jpg'
					}, {
						name: this.$t('已参与'),
						zn: HTTP_IMG_UTL + 'Zyicanyu.jpg',
						ru: HTTP_IMG_UTL + 'yicanyu.jpg'
					}, {
						name: this.$t('进行中'),
						zn: HTTP_IMG_UTL + 'Zjinxinzhong.jpg',
						ru: HTTP_IMG_UTL + 'jinxingzhong.jpg'
					}, {
						name: this.$t('已完成'),
						zn: HTTP_IMG_UTL + 'Zyiwancheng.jpg',
						ru: HTTP_IMG_UTL + 'yiwancheng.jpg'
					},
					{
						name: this.$t('申请售后'),
						zn: HTTP_IMG_UTL + 'Zyiwancheng.jpg',
						ru: HTTP_IMG_UTL + 'yiwancheng.jpg'
					},
				],
				value0: 0,
				value1: 1,
				value2: 2,
				options0: [{
						label: this.$t('全部'),
						label_ru: this.$t('全部'),
						value: 0,
					},
					{
						label: this.$t('正常'),
						label_ru: this.$t('正常'),
						value: 1,
					},
					{
						label: this.$t('异常'),
						label_ru: this.$t('异常'),
						value: 2,
					},
				],


				options1: [{
						label: this.$t('不限'),
						label_ru: this.$t('不限'),
						value: '',
					},
					{
						label: this.$t('货物') + this.$t('竞标'),
						label_ru: this.$t('货物') + this.$t('竞标'),
						value: 'goods',
					},
					{
						label: this.$t('运输') + this.$t('竞标'),
						label_ru: this.$t('运输') + this.$t('竞标'),
						value: 'transport',
					},
					{
						label: this.$t('跨境货代') + this.$t('竞标'),
						label_ru: this.$t('跨境货代') + this.$t('竞标'),
						value: 'crossborder',
					},
					{
						label: this.$t('专业代办') + this.$t('竞标'),
						label_ru: this.$t('专业代办') + this.$t('竞标'),
						value: 'professional',
					}
				],
				options2: [{
						label: this.$t('不限'),
						label_ru: this.$t('不限'),
						value: '',
					},
					{
						label: this.$t('近三天'),
						label_ru: this.$t('近三天'),
						value: 3,
					},
					{
						label: this.$t('近五天'),
						label_ru: this.$t('近五天'),
						value: 5,
					},
					{
						label: this.$t('近七天'),
						label_ru: this.$t('近七天'),
						value: 7,
					},
				],
				orderList: [],
				search: '',
				pop: {},
				triggered: false, //刷新设置

				listLang: [],
				page: 1, //分页
				identity_type: ""
			}
		},
		onLoad() {

		},
		onShow() {
			this.getList()
			this.setTabbarName()

			// this.getC2cUnreadMsgNum()
			this.$store.commit("getC2cUnreadMsgNum")
			let identity_type = uni.getStorageSync('userInfoFull');
			this.identity_type = identity_type.identity_type
		},
		onReady() {
			this.getScrollW()
			uni.setNavigationBarTitle({
				title: this.$t("订单")
			})
		},
		methods: {
			setTabbarName() {
				if (uni.getStorageSync("lang") != 'ru') {
					uni.setTabBarItem({
						index: 0, // tabIndex，tabbar的哪一项，从0开始
						text: '首页', // 新的名称
					});
					uni.setTabBarItem({
						index: 1, // tabIndex，tabbar的哪一项，从0开始
						text: '工作台', // 新的名称
					});
					uni.setTabBarItem({
						index: 2, // tabIndex，tabbar的哪一项，从0开始
						text: '发布', // 新的名称
					});
					uni.setTabBarItem({
						index: 3, // tabIndex，tabbar的哪一项，从0开始
						text: '消息', // 新的名称
					});
					uni.setTabBarItem({
						index: 4, // tabIndex，tabbar的哪一项，从0开始
						text: '我的', // 新的名称
					});
				} else {
					uni.setTabBarItem({
						index: 0, // tabIndex，tabbar的哪一项，从0开始
						text: 'Главная', // 新的名称
					});
					uni.setTabBarItem({
						index: 1, // tabIndex，tabbar的哪一项，从0开始
						text: 'Кабинет', // 新的名称
					});
					uni.setTabBarItem({
						index: 2, // tabIndex，tabbar的哪一项，从0开始
						text: 'Опубликовать', // 新的名称
					});
					uni.setTabBarItem({
						index: 3, // tabIndex，tabbar的哪一项，从0开始
						text: 'Сообщения', // 新的名称
					});
					uni.setTabBarItem({
						index: 4, // tabIndex，tabbar的哪一项，从0开始
						text: 'Мой', // 新的名称
					});
				}
			},
			getC2cUnreadMsgNum() {
				const that = this
				var mobile = uni.getStorageSync('mobile');

				that.isShow = 1
				that.$u.api.message.getC2cUnreadMsgNum({
					mobile: mobile,
				}).then(res => {
					that.$u.api.basic.getNoticeNum().then(r => {
						that.listLang = [{
								iconPath: "/static/images/tabbar/newStyle/t1.png",
								selectedIconPath: "/static/images/tabbar/t1s.png",
								text: that.$t('首页'),
								// count: 2,
								// isDot: true,
								customIcon: false,
								pagePath: '/pages/tabbar/index'
							},
							{
								iconPath: "/static/images/tabbar/newStyle/t2.png",
								selectedIconPath: "/static/images/tabbar/t2s.png",
								text: that.$t('订单'),
								customIcon: false,
								// isDot: true,
								pagePath: '/pages/tabbar/order/index'
							},
							{
								iconPath: "/static/images/tabbar/newStyle/t3.png",
								selectedIconPath: "/static/images/tabbar/t3s.png",
								text: that.$t('发布'),
								midButton: true,
								customIcon: false,
								pagePath: '/pages/tabbar/release/index'
							},
							{
								iconPath: "/static/images/tabbar/newStyle/t4.png",
								selectedIconPath: "/static/images/tabbar/t4s.png",
								text: that.$t('消息'),
								count: Number(res.AllC2CUnreadMsgNum) + Number(r.other) + Number(r
									.system),
								customIcon: false,
								pagePath: '/TUIKit/components/TUIConversation/list'
							},
							{
								iconPath: "/static/images/tabbar/newStyle/t5.png",
								selectedIconPath: "/static/images/tabbar/t5s.png",
								text: that.$t('我的'),
								// count: 23,
								// isDot: false,
								customIcon: false,
								pagePath: '/pages/tabbar/user/index'
							},
						]
						that.isShow = 0

					})
				})
			},


			// 下拉刷新
			// scrolltolower1(e) {				
			// 	this.triggered = true;
			// 	this.page = 1
			// 	this.orderList = []		
			// 	this.getList()
			// },
			// 滑轮滚动到顶
			scrolltolowers(e) {
				if (this.orderList.length === 0) {
					return
				}
				this.page++
				this.getList()
			},
			districts(val) {
				return val.length > 6 ? val.slice(0, 6) + "..." : val
			},
			getList() {
				const that = this
				uni.showLoading({
					title: "Loading...",
					mask: true
				})
				this.$u.api.order.getOrderList({
					zhuangtai: that.value0,
					status: that.current - 1,
					search: that.search,
					page: that.page
				}).then(res => {
					if (that.page == 1) {
						that.orderList = res
					} else {
						var list1 = res
						if (res) {
							that.orderList = [...that.orderList, ...list1]
						}
					}
					that.triggered = false;
					uni.hideLoading()
				}).catch(err => {
					uni.hideLoading()
				})
			},


			change(index) {
				if (index == '4') {
					this.$u.api.order.getRatePopup().then(res => {
						this.pop = res
						if (Object.keys(this.pop).length != 0) this.show = true
					})
				} else {
					this.show = false
				}
				this.current = index;
				this.page = 1
				this.orderList = []
				this.getList()
			},

			select(value) {
				this.search = value
				this.getList()
				//选择
				console.log(value)
			},


			//点击查看订单详情  进行中的订单跳 另一个页
			details(id, isDetail, status, join_order_id = 0, type = '') {

				console.log(id, isDetail, status, join_order_id, type)

				var options_status = '';
				/*状态:0=待参与,
				1=已参与,
				2=进行中(已合作),
				3=已取消,
				4=申请售后,
				5=售后已完成,
				6=发布方确认收货(进行中),
				7=已评价,
				8=同意延期付款(已完成),
				9=未付款(不同意延期),
				10=已完成,
				11=待开始
				*/
				if (status == 0) {
					options_status = 0
				} else if (status == 1) {
					options_status = 1
				} else if (status == 2) {
					options_status = 2
				} else if (status == 3) {
					options_status = 3
				} else if (status == 4) {
					options_status = 3
				} else if (status == 5) {
					options_status = 3
				} else if (status == 6) {
					options_status = 2
				} else if (status == 7) {
					options_status = 3
				} else if (status == 8) {
					options_status = 3
				} else if (status == 9) {
					options_status = 2
				} else if (status == 10) {
					options_status = 3
				} else if (status == 11) {
					options_status = 2
				}

				if ((options_status == 2) || (options_status == 3)) {
					if ((type == 'goods') || (type == 'transport') || (type == 'crossborder')) {
						this.$u.route({
							url: "/pages/ordering/orderDetail",
							params: {
								id: id,
								join_order_id: join_order_id,
								status: options_status,
								isDetail: isDetail
							}
						})
					} else {
						this.$u.route({
							url: "/pages/order/published/published",
							params: {
								id: id,
								status: options_status,
								isDetail: isDetail
							}
						})
					}

				} else {
					this.$u.route({
						url: "/pages/order/published/published",
						params: {
							id: id,
							status: options_status,
							isDetail: isDetail
						}
					})
				}


			},

			orderStatus2(status) {
				if (status == 0) {
					return this.$t('待参与');
				}
				if (status == 1) {
					return this.$t('已参与');
				}
				if (status == 2) {
					return this.$t('进行中');
				}
				if (status == 3) {
					return this.$t('已关闭');
				}
				if (status == 4) {
					return this.$t('申请售后');
				}
				if (status == 5) {
					return this.$t('售后已完成');
				}
				if (status == 6) {
					return this.$t('确认收货');
				}
				if (status == 7) {
					return this.$t('已评价');
				}
				if (status == 8) {
					return this.$t('同意延期付款');
				}
				if (status == 9) {
					return this.$t('未付款');
				}
				if (status == 10) {
					return this.$t('已完成');
				}
				if (status == 11) {
					return this.$t('待开始');
				}
			},

			chaxun(status) {
				var flag = true
				if (status == 0) {
					flag = false
				}
				if (status == 1) {
					flag = false
				}
				if (status == 3) {
					flag = false
				}
				if (status == 9) {
					flag = false
				}
				return flag
			},
			goRatie(id) {
				this.$u.route({
					url: "/pages/order/evaluate/takepart",
					params: {
						order_id: id,
						type: 'join'
					}
				})
			},
			mapMode(str) {
				let arr = str.split(',')
				let ret = ''
				for (let i in arr) {
					if (i > 0) {
						ret += ',' + this.$t(arr[i])
					} else {
						ret += this.$t(arr[i])
					}
				}
				return ret
			},
			estimate() {
				var type = this.pop.type
				if ((type == 'goods') || (type == 'transport') || (type == 'crossborder')) {

					var options_status = '';
					var status = Number(this.pop.status);
					if (status == 0) {
						options_status = 0
					} else if (status == 1) {
						options_status = 1
					} else if (status == 2) {
						options_status = 2
					} else if (status == 3) {
						options_status = 3
					} else if (status == 4) {
						options_status = 3
					} else if (status == 5) {
						options_status = 3
					} else if (status == 6) {
						options_status = 2
					} else if (status == 7) {
						options_status = 3
					} else if (status == 8) {
						options_status = 3
					} else if (status == 9) {
						options_status = 2
					} else if (status == 10) {
						options_status = 3
					} else if (status == 11) {
						options_status = 2
					}


					this.$u.route({
						url: "/pages/ordering/orderDetail",
						params: {
							id: this.pop.id,
							join_order_id: this.pop.join_order_id,
							status: options_status,
							isDetail: true
						}
					})
				} else {
					this.$u.route({
						url: "pages/order/published/published",
						params: {
							id: this.pop.id,
							status: Number(this.pop.status)
						}
					})
				}

			},
			giveup(e) {
				let me = this;
				uni.showModal({
					content: me.$t("确认放弃?"),
					cancelText: this.$t('否'),
					confirmText: this.$t('是'),
					success(modalRes) {
						if (modalRes.confirm) {
							me.$u.api.order.giveup({
								order_id: e.order_id,
								join_order_id: e.id
							}).then(res => {
								me.$u.toast(me.$t('已提交'))
								setTimeout(function() {
									me.change(2)
								}, 2000);
							})
						}
					}
				})
			},
			// 获取标题区域宽度，和每个子元素节点的宽度以及元素距离左边栏的距离
			getScrollW() {
				const query = uni.createSelectorQuery().in(this);
				query.select('.content-scroll').boundingClientRect(data => {
					// 拿到 scroll-view 组件宽度
					this.contentScrollW = data.width
				}).exec();
				query.selectAll('.scroll-item').boundingClientRect(data => {
					let dataLen = data.length;
					for (let i = 0; i < dataLen; i++) {
						//  scroll-view 子元素组件距离左边栏的距离
						this.list[i].left = data[i].left;
						//  scroll-view 子元素组件宽度
						this.list[i].width = data[i].width
					}
				}).exec()
			}
		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .u-dropdown__menu {
		margin-bottom: 0 !important;
		margin-top: 0 !important;
	}

	page {
		background-color: #fff;
	}

	.my-text {
		font-size: 12px;
	}

	/*横向滚动操作*/
	.lxy-content {
		width: 100%;
		height: 100rpx;
		box-sizing: border-box;

		.content-scroll {
			height: 100rpx;
			white-space: nowrap;

			.scroll-item {
				display: inline-block;
				text-align: center;
				margin-right: 28rpx;
				padding-right: 0 24rpx;

				&.active {
					color: #FFFFFF;
				}
			}

			.scroll-item:last-child {
				margin-right: 28rpx;
			}
		}
	}

	@keyframes changeImg {
		from {
			left: -100%;
		}

		100% {
			left: 150%;
		}
	}

	.my-order-item {
		display: flex;
		margin-bottom: 20rpx;
		padding-left: 0rpx;
		margin-top: -20px;
	}

	.tabs {
		width: 23%;
		height: 60rpx;
		border-radius: 10rpx;
		text-align: center;
		line-height: 60rpx;
		overflow: hidden;
		background-color: #f6f6f6;
		color: #999999;
		margin: 10px;
		font-size: 24rpx;
	}

	.tabs_ru {
		border-radius: 10rpx;
		text-align: center;
		line-height: 26rpx;
		word-break: break-word;
		font-size: 12px;
		background-color: #f6f6f6;
		color: #999999;
		padding: 12rpx;
		margin: 2px;
	}

	.order_top {
		//padding-top: 97.67rpx;
		// position: fixed;
		// top: 0;
		// left: 0;
		width: 100%;
		background: #FFFFFF;
		box-shadow: 0rpx 3rpx 7rpx 0rpx rgba(233, 233, 233, 0.5);
		border-radius: 0rpx 0rpx 12rpx 12rpx;
	}

	._page {
		// margin-top: 250.93rpx;
		display: flex;
		flex-direction: column;
	}

	.order_body {
		flex: 1;
		padding: 24.2rpx;
		overflow: scroll;

		.order_card {
			margin-top: 20.93rpx;
			// min-height: 427rpx;
			// background: #FFFFFF;
			// box-shadow: 0rpx 3rpx 7rpx 0rpx rgba(207, 207, 207, 0.5);
			// border-radius: 14rpx;
			// overflow: hidden;
		}
	}

	.order_body_top {
		display: flex;
		flex-direction: column;

		// height: 291.28rpx;
		.order_btn {
			display: flex;
			justify-content: space-between;

			.order_btn_view {
				// background: url("/static/images/order/jvxing.png");
				background: linear-gradient(132deg, #FBAA52 0%, #E96444 100%);
				// width: 200rpx;
				height: 43.6rpx;
				// display: flex;
				// justify-content: center;
				// align-items: center;
				color: $my-bgColorFFFFFF;
				// overflow: hidden;
				// white-space: nowrap;
				// text-overflow: ellipsis;
				padding: 10rpx;
				line-height: 23rpx;
				text-align: center;
				position: relative;

				&::after {
					position: absolute;
					animation: changeImg 3s ease 0s;
					top: 0;
					width: 30%;
					height: 100%;
					content: "";
					background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .4) 50%, rgba(255, 255, 255, 0) 100%);
					transform: skewX(-45deg);
					animation-iteration-count: infinite;
				}
			}
		}
	}

	.order_list {
		margin-top: 34.88rpx;
		padding-left: 26.16rpx;
		// font-size: 29rpx;
		font-weight: 400;
		color: #0B0B0B;
		line-height: 40rpx;

		view {
			margin-bottom: 15rpx;
		}

		text {
			&:first-child {
				color: #aaa;
			}

			&:last-child {
				color: #333;
				font-size: 32rpx;
			}
		}
	}

	.order_address {
		padding-top: 26.16rpx;
		padding-bottom: 12rpx;
		padding-left: 26.16rpx;
		border-bottom: 2rpx solid #E5E5E5;

		view {
			display: flex;
			flex-direction: row;
			font-size: 29rpx;
			font-weight: 400;
			color: #888888;
			line-height: 30rpx;
			padding-bottom: 10rpx;
		}

		text {
			font-size: 29rpx;
			font-weight: 400;
			color: #888888;
			line-height: 30rpx;
		}
	}

	.order_body_details {
		display: flex;
		flex-direction: row;
		justify-content: stretch;
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;

		&>view {
			width: 100%;
		}

		// margin-top: 63rpx;
	}

	.itemBox {
		padding-bottom: 70rpx;
	}

	.order_body_details1 {
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
		padding: 19.19rpx;
	}

	.border {
		//border: 6rpx solid rgb(27, 27, 111);
		background: linear-gradient(180deg, #E7FDB3 -2%, #FFFFFF 85%);
		color: #3d3d3d;
		font-weight: bold;
	}

	.my-edit {
		// background: linear-gradient(132deg, #FBAA52 0%, #E96444 100%);
		// color: #FFFFFF;
		// padding: 4rpx;
		// max-width: 200rpx;
		// font-size: 12px;
		max-width: 240rpx;
		height: 100%;
		background: linear-gradient(132deg, #FBAA52 0%, #E96444 100%);
		border-radius: 14rpx;
		font-size: 29rpx;
		font-weight: 600;
		color: #FFFFFF;
		line-height: 29rpx;
		padding: 15rpx;
		box-sizing: border-box;
		margin-right: 30rpx;
		text-align: center;
	}

	.estimate {
		display: flex;
		justify-content: space-around;

		view {
			width: 140rpx;
			height: 80rpx;
			// text-align: center;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-top: 80rpx;
		}
	}

	.order_body_details {}

	.three {
		.button:nth-of-type(1) {
			border-bottom-right-radius: 0;
			background: #f6f6f6 !important;
		}

		.button:nth-of-type(2) {
			border-bottom-left-radius: 0;
			border-bottom-right-radius: 0;
			background: linear-gradient(to right, #D7F09D 0%, #F8FCF1 81%);
		}

		.button:nth-of-type(3) {
			border-bottom-left-radius: 0;
		}
	}

	.button {
		width: 100%;
		background: linear-gradient(99deg, #FF8C7B 15%, #FFD1A2 99%);
		color: #3d3d3d;
		font-size: 24rpx;
		line-height: 35rpx;
		text-align: center;
		padding: 15rpx;
		bottom: 0;
		left: 0;
		border-radius: 0 0 14rpx 14rpx;
	}

	.circle_ {
		width: 35rpx;
		height: 35rpx;
		border: 1px solid #ccc;
		background-color: #ffffff;
		border-radius: 50rpx;
		float: left;
		margin-top: 10rpx;
	}

	.after_sale_text {
		width: 60%;
		font-size: 10px;
		text-align: left;
		margin: 0rpx 3%;
		padding: 20rpx 0rpx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		position: relative;
	}

	.after_sale_time {
		width: 40%;
		font-size: 10px;
		text-align: right;
		margin: 0rpx 10rpx;
		padding: 20rpx 0rpx;
	}

	.scroll-view {
		white-space: nowrap;
	}

	.scroll-text {
		display: inline-block;
		width: 100%;
		animation: scroll-animation 3s linear infinite;
	}

	@keyframes scroll-animation {
		0% {
			transform: translateY(0);
		}

		100% {
			transform: translateY(-150%);
		}
	}

	.status-bar {
		margin-top: var(--status-bar-height);
		height: 24rpx;
	}

	.type-status {
		padding: 5rpx 16rpx;
		background-color: #06C36E;
		color: white;
		border-radius: 10rpx;
	}

	// 2024/11/15 新增
	.order_body_details.purchase_wrap {
		.button {
			color: #fff;
			height: 70rpx;
			border-radius: 0px 0px 32rpx 32rpx;
			background: linear-gradient(270deg, #CCE7F9 0%, #5282E6 100%);
		}
	}

	.right_title {
		color: #3d3d3d;
		font-size: 12px;
		float: right;
	}

	.pur_color {
		.right_title {
			color: #47A8FF;
		}

	}

	.my_wrap {
		padding: 2px 4px;
		background-color: #06C36E;
		color: white;
		border-radius: 10rpx;
	}

	.pur_style {
		&.my_wrap {
			border-radius: 10rpx;
			padding: 10rpx 16rpx;
			display: inline-flex;
		}
	}
</style>